package com.goblin.model.uaa.controller;

import com.goblin.common.response.PageHelper;
import com.goblin.common.response.Paged;
import com.goblin.common.response.Response;
import com.goblin.model.base.BaseController;
import com.goblin.model.uaa.po.Role;
import com.goblin.model.uaa.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/uaa/role")
public class RoleController extends BaseController<Role> {

	@Autowired
	private RoleService roleService;

	@GetMapping("/roles")
	public Response<Paged<Role>> paged(PageHelper pageable) {
		Paged<Role> entities = this.roleService.paged(pageable);
		return Response.success(entities);
	}

	@Override
	public <T> Object afterSave(T t) {
		return super.afterSave(t);
	}
}
